package com.ronglian.ucdisk.share;

import java.util.UUID;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="share_receiver_entity")
public class ShareReceiverEntity {
	@Id private String id = UUID.randomUUID().toString();
	//public String shareEventId;
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="share_event_id")
	private ShareEvent event;
	private String receiverId;
	private String receiverType;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public ShareEvent getEvent() {
		return event;
	}
	public void setEvent(ShareEvent event) {
		this.event = event;
	}
	public String getReceiverId() {
		return receiverId;
	}
	public void setReceiverId(String receiverId) {
		this.receiverId = receiverId;
	}
	public String getReceiverType() {
		return receiverType;
	}
	public void setReceiverType(String receiverType) {
		this.receiverType = receiverType;
	}
	public boolean isSingle(){
		return "single".equals(receiverType) ; 
	}
	public boolean isTeam() {
		return "team".equals(receiverType);
	}
	
}
